<?php

/**
 * Interface of the "pseudo" OR-Mapper heart: the AutoUpdater
 * declares common methodes to select Phlames/data
 */
interface AutoUpdaterInterface extends Mapper
{
    /**
     * Define the writeright you want to use for the next query
     * @param SHARE/LOCK $mode
     * @return AutoUpdater $this
     */
    public function setWriteRight($mode = AutoUpdaterImpl::LOCK);

    /**
     * Forces the update with the database
     * Gets called at object destruction too.
     */
    public function update();
    
    /**
     * get the selected IDs of the last query
     * @return array $ids
     */
    public function getIDs();
    
    /**
     * Query: Select the whole table, made for testing
     * @return AutoUpdater $this
     */
    public function selectAll();
    
    /**
     * Query: Select specific IDs 
     * @param array $ids
     * @return AutoUpdater $this
     */
    public function selectByIDs(array $ids);
}

class AutoUpdaterException extends PhException
{}